<%@page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html class="root61">
<head>
	<%@include file="/views/common/include/taglib.jsp"%>
	<%@include file="/views/common/include/head.jsp"%>
	<link type="text/css" rel="stylesheet" href="${ctx }/css/dlifestyle/sectionparent.css" source="widget" />
	<link type="text/css" rel="stylesheet" href="${ctx }/css/dlifestyle/admin.css" source="widget" />
</head>
<body style="margin: 0px">
	<section class="mainborder">
       <section class="edit_scrollable padder">
         <div class="edit_content">
		<form id="myFrom">
			 <div class="form" >
			 <div class="item">
					<label class="col-sm-1 editlable">类型：</label>
					<div class="fl">
						<c:if test="${menu.type == 1}">
						<input style="width:100px;" class="editform-control" id="ttype" value="菜单" type="text" class="text" readonly="readonly">
						</c:if>
					</div>
				</div>
			    <div class="item">
					<label class="col-sm-1 editlable">菜单名：</label>
					<input id="menuId" type="hidden" value="${menu.id }">
					<input id="mLevel" type="hidden" value="${menu.menuLevel }">
					<input id="mParent" type="hidden" value="${menu.parentId }">
			   		<div class="fl">
						<input class="editform-control" id="menuName" value="${menu.menuName}" type="text"
						onblur="checkMenuName()" maxlength="10" class="text" placeholder="请输入菜单名" required>
						<em class="emStyle">*</em>
					</div>
				</div>
				<div class="item">
					<label class="col-sm-1 editlable">本地路径：</label>
					<div class="fl">
						<input class="editform-control" id="locationURL" value="${menu.locationURL}" type="text" maxlength="50" class="text" placeholder="请输入本地路径" required>
					</div>
				</div>
				<div class="item">
                    <label class="col-sm-1 editlable">顺序：</label>
                    <div class="fl">
                        <input type="number" class="editform-control" value="${menu.menuOrder}" id="menuOrder" style="width:90px;"
                        onblur="checkMenuOrder()" class="form-control" placeholder="从小到大排序" maxlength="3" required>
                    <em class="emStyle">*</em>
                    </div>
	            </div>
	            <div class="item">
					<label class="col-sm-1 editlable">所属系统：</label>
					<div class="fl">
						 <select id="system" class="editform-control" onblur="checkSystem()" style="height:29px;width:100px;">
	                    	<option value="-1" <c:if test="${menu.system == -1 }">selected="selected"</c:if>>--所属系统--</option>
	                        <option value="1" <c:if test="${menu.system == 1 }">selected="selected"</c:if>>运营/物业</option>
	                        <option value="2" <c:if test="${menu.system == 2 }">selected="selected"</c:if>>商户端</option>
	                        <option value="3" <c:if test="${menu.system == 3 }">selected="selected"</c:if>>业主端</option>
	                        <option value="4" <c:if test="${menu.system == 4 }">selected="selected"</c:if>>配送端</option>
	                    </select>
                 		<em class="emStyle">*</em>
                   </div>
				</div>
	            <div class="item" id="menuTypeArea">
					<label class="col-sm-1 editlable">菜单范围：</label>
					<div class="fl">
						 <select id="menuType" class="editform-control" onblur="checkMenuType()" style="height:29px;width:100px;">
	                    	<option value="-1" <c:if test="${menu.menuType == -1 }">selected="selected"</c:if>>--菜单范围--</option>
	                        <option value="1" <c:if test="${menu.menuType == 1 }">selected="selected"</c:if>>平台菜单</option>
	                        <option value="2" <c:if test="${menu.menuType == 2 }">selected="selected"</c:if>>小区菜单</option>
	                    </select>
                 		<em class="emStyle">*</em>
                   </div>
				</div>
				<div class="item" id="menuLevelArea">
					<label class="col-sm-1 editlable">菜单级别：</label>
					<div class="fl">
						 <select id="menuLevel" class="editform-control" onblur="checkMenuLevel()" style="height:29px;width:100px;">
	                    	<option value="-1" <c:if test="${menu.menuLevel == -1 }">selected="selected"</c:if>>--菜单等级--</option>
	                        <option value="1" <c:if test="${menu.menuLevel == 1 }">selected="selected"</c:if>>一级菜单</option>
	                        <option value="2" <c:if test="${menu.menuLevel == 2 }">selected="selected"</c:if>>二级菜单</option>
	                        <option value="3" <c:if test="${menu.menuLevel == 3 }">selected="selected"</c:if>>三级菜单</option>
	                    </select>
                 		<em class="emStyle">*</em>
                   </div>
				</div>

	            	<div class="item" id ="parentMenu" <c:if test="${type == 1 }">style="margin-bottom:0px;display:none;"</c:if>>
	                   <label class="col-sm-1 editlable">上级菜单：</label>
	                   <div class="fl">
	                   		<c:if test="${type == 1 }">
	                       <select class="editform-control" style="height:29px;width:150px;" id="parentId" name="parentId" required>
	                           <option value="${menu.parentId }">${pMenu.menuName}</option> 
	                       </select>
	                       </c:if>
	                       <c:if test="${type == 2 }">
	                       <select class="editform-control" style="height:29px;width:150px;" id="parentId" name="parentId" required >
	                       	   <c:forEach items="${listMenu }" var="item" varStatus="itemStatus">
	                           		<option value="${item.id }" <c:if test="${item.menuName == pMenu.menuName}" >selected="selected"</c:if>>${item.menuName}</option>
	                           </c:forEach> 
	                       </select>
	                       </c:if>
	                     </div>
	                </div>
			</div>
		</form>
		</div>
		</section>
		</section>
                 
	<script type="text/javascript">
		document.getElementById("myFrom").reset();
	</script>
		<script src="${ctx}/js/controllers/system/menubutton/MenuButtonEditController.js" type="text/javascript"></script>
	<script type="text/javascript">
		var ctx = '${ctx}';
		setCtx(ctx);
		
	</script>	
	<!-- 解决ie 6 7 8 9不能显示placeholder的问题 -->
	<script src="${ctx}/js/lib/jquery.JPlaceholder.js"></script>
</body>
</html>
